<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="title">标题</div>
    <div id="desc">描述</div>
    <div><button id="btn">跳转</button></div>
    <script>
      document.getElementById("btn").addEventListener("click", function () {
        const title = document.getElementById("title").innerText;
        const desc = document.getElementById("desc").innerText;
        // 页面跳转与传参（页面内跳转）
        location.href = `second.html?title=${title}&desc=${desc}`;
        // 另外启一个窗口跳转
        // window.open(`second.html?title=${title}&desc=${desc}`);
      });

      let a = "我是中国人";
      let b = "我很骄傲";
    </script>
  </body>
</html>
